{layout name="passport:layout" /}
<div id="actionbar">
    <a href="{:url('passport.member/staffAdd')}" class="button button-blue"><i class="iconfont icon-add_icon"></i>添加员工</a>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w60 fn-tac">#</th>
            <th class="w260">操作</th>
            <th class="w160">所属应用</th>
            <th class="w120">手机号</th>
            <th>昵称</th>
            <th class="w140">登录IP</th>
            <th class="w140">登录时间</th>
            <th class="w140">创建时间</th>
            <th class="w70 fn-tac">状态</th>
        </tr>
    </thead>
    <tbody>
        {foreach $list as $vo}
        <tr>
            <td class="fn-tac">{$vo['id']}</td>
            <td class="button-group">
                <a class="button" href="{:url('passport.member/staffEdit',array('id'=>$vo.id))}" title="编辑"><i class="iconfont icon-edit"></i>编辑</a>
                <a class="button isLock" url="{:url('passport.member/staffLock',array('id'=>$vo.id))}" href="javascript:;" title="锁定/解锁">{if $vo.is_lock}<i class="iconfont icon-xiugaidenglumima"></i>解锁{else}<i class="iconfont icon-password_icon"></i>锁定{/if}</a>
                <a class="button isDel" url="{:url('passport.member/staffDelete',['id'=>$vo.id])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i>删除</a>
            </td>
            <td>{$vo.miniapp.appname}</td>
            <td>{$vo.phone_id}</td>
            <td>{$vo.username}</td>
            <td>{$vo.login_ip}</td>
            <td>{$vo->login_time|date='Y-m-d H:i'}</td>
            <td>{$vo->create_time|date='Y-m-d H:i'}</td>
            <td class="fn-tac li">{if $vo.is_lock}<span class="badge bg-red">锁定</span>{else}<span class="badge">正常</span>{/if}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
<div class="page">{$list|raw}</div>
<script type="text/javascript">
    Do('base', 'layer', function () {
        $('.isDel').isDel();
        $('.isLock').click(function () {
            var url = $(this).attr("url");
            parent.layer.confirm('确认要锁定当前用户?',{ icon: 3,title: '友情提示' }, function (index) {
                $.getJSON(url, function (data) {window.location.reload();});
                parent.layer.close(index);
            });
        })
    })
</script>